/////////////////////////////////////////////////////////////////////////////// 
//// FileName: SocketAPI.h
//// Description: Socket routines header
//// Author: Charlie Chang (sengfu@gmail.com)
//// All right reserved 2014.
////  Revision History:
////      Create Date: 2014/08/27
////      
////////////////////////////////////////////////////////////////////////////////

#ifndef _SOCKETAPI____H_
#define _SOCKETAPI____H_

#ifdef LINUX
#include <netinet/in.h>
#endif

#ifdef WIN32DLL
#include <winsock2.h>
#include <ws2tcpip.h>
#endif

#include "iPN_Type.h"

INT32 __setup_listen_port( UINT16 portno);
INT32 __over_time_receive(INT32 skt, CHAR* buf, INT32 bufsize, struct sockaddr_in *client, UINT32 timeout_ms);
INT32 SendMessage(CHAR *buf, INT32 size, INT32 sockfd, const struct sockaddr_in *dest);
INT32 ResolveHostName(const char *szHostName, struct sockaddr_in *sockAddr);

#endif  //#ifndef _SOCKETAPI____H_

